package com.zjmcollege.hotpot.search.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import javax.persistence.*;
import java.sql.Timestamp;


/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief
 * @email 122162005@qq.com
 * @date 2019-11-08 09:49
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "search_result")
public class SearchResultModel {
    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator",
            strategy = "com.zjmcollege.hotpot.search.model.IdGenerator",
            parameters = {@Parameter(name = "idLength", value = "20")})
    private String id;
    /**
     * 文章标题
     */
    private String title;
    /**
     * 简介
     */
    private String brief;

    /**
     * 文章 所对应的logo url
     */
    @Column(name = "logo_url")
    private String logoUrl;

    private String url;

    /**
     * 发表时间
     */
    @Column(name = "posted_time")
    private Timestamp postedTime;

    private String author;
    /**
     * 支持该搜索结果，支持的人越多，排名越靠前
     */
    private Integer support = 0;
    /**
     * 反对该搜索结果，
     */
    private Integer oppose = 0;
}
